<ot-view>
    <div class="row">
        <div class="col-md-12 alert alert-info" ng-show="apiLoading">
            <span class="ot-loading-indicator"></span>
            Loading the API...
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 alert alert-info" ng-show="showHelp">
            <p>
                <span class="ot-api-doc-method-root-api"></span>
                This method can be accessed without any parameter and can be navigated through
                by clicking on the associated link.
            </p>
            <p>
                <span class="ot-api-doc-method-root"></span>
                This method can be accessed without any parameter but is not navigable (but can
                accessed through other navigable APIs).
            </p>
            <p>
                <span class="ot-api-doc-method-no-root"></span>
                This method needs parameters to be called, is not navigable as such, but can be
                accessed through other navigable APIs.
            </p>
            <p>
                <span class="ot-api-doc-method-warning"></span>
                Some navigable methods may not be accessible according to your authorisations.
            </p>
        </div>
    </div>
    <table class="table table-hover table-condensed ot-api-doc">
        <tbody
                ng-repeat="apiInfo in list.resources | orderBy: 'name'"
                ng-show="(show == 'all') || (show == 'root' && apiInfo.root) || (show == 'root+api' && apiInfo.root && apiInfo.getMethod)">
        <tr>
            <th colspan="4">
                <span class="ot-api-doc-title">{{apiInfo.name}}</span>
                <span ng-if="apiInfo.description" class="ot-api-doc-description">
                    <br/>
                    {{apiInfo.description}}
                </span>
            </th>
        </tr>
        <tr
                ng-repeat="apiMethodInfo in apiInfo.methods"
                ng-show="(show == 'all') || (show == 'root' && apiMethodInfo.root) || (show == 'root+api' && apiMethodInfo.root && apiMethodInfo.getMethod)">
            <td>
                <span class="ot-api-doc-method-root-api" ng-if="apiMethodInfo.root && apiMethodInfo.getMethod"></span>
                <span class="ot-api-doc-method-root" ng-if="apiMethodInfo.root && !apiMethodInfo.getMethod"></span>
                <span class="ot-api-doc-method-no-root" ng-if="!apiMethodInfo.root"></span>
            </td>
            <td>
                <span class="ot-api-doc-method-name">{{apiMethodInfo.name}}</span>
                <span ng-if="apiMethodInfo.description" class="ot-api-doc-method-description">
                    <br/>
                    {{apiMethodInfo.description}}
                </span>
            </td>
            <td class="ot-api-doc-method-methods">
                <span ng-repeat="m in apiMethodInfo.methods" class="ot-api-{{m | lowercase}}">{{m}}</span>
            </td>
            <td class="ot-api-doc-method-path">
                <a ng-if="apiMethodInfo.root && apiMethodInfo.getMethod" ng-click="followApi(apiMethodInfo.path)">{{apiMethodInfo.path}}</a>
                <span ng-if="!apiMethodInfo.root || !apiMethodInfo.getMethod">{{apiMethodInfo.path}}</span>
            </td>
        </tr>
        </tbody>
    </table>
</ot-view>